/******************************************************************************
 * * dummy_modem_adp.c - dummy function for modem adapter
 *
 * *(C) Copyright 2019 Asr International Ltd.
 * * All Rights Reserved
 * ******************************************************************************/
#include <stdio.h>
#include <string.h>
#include "ui_type.h"
#include "../../lvgl/hal/hal.h"
#include "inter_modemadp_interface.h"
#include "ui_log.h"
#include "../apps/sms/sms_include.h"

#if USE_LV_WATCH_MODEM_ADAPTOR == 0
TIMER_ID         dummy_tm;
MMI_MODEM_SIM_ID dummysimId;
MMI_Modem_Call_t Calls[2];
UINT8            ccwa       = 0;
INT32            DummyIndex = 0;
UINT8            swapflg    = 0;
TIMER_ID         DummyIdleProc;
UINT32           DummyIdleTick;

typedef struct
{
    MMI_MODEM_PIN_STATUS_TYPE PinStatus;
    INT8                      Pin1[4];
    UINT8                     Pin1RetryLeft;
    INT8                      Pin2[4];
    UINT8                     Pin2RetryLeft;
    INT8                      Puk1[8];
    UINT8                     Puk1RetryLeft;
    INT8                      Puk2[8];
    UINT8                     Puk2RetryLeft;
} Dummy_Sim_Pin_Info_t;

Dummy_Sim_Pin_Info_t Sim1Pin;
Dummy_Sim_Pin_Info_t Sim2Pin;

VOID Dummy_Idle_Tick_Timeout(VOID* para)
{
    MMI_Modem_Sim_Status_t *SimStatus;

    if (DummyIdleTick++ == 2)
    {
        SimStatus             = (MMI_Modem_Sim_Status_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Sim_Status_t));
        SimStatus->SimId      = MMI_MODEM_SIM_1;
        SimStatus->SimPresent = TRUE;
        SimStatus->Pin1Status = Sim1Pin.PinStatus;
        Phone_Modem_Sim_Status_Ind(SimStatus);

        SimStatus             = (MMI_Modem_Sim_Status_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Sim_Status_t));
        SimStatus->SimId      = MMI_MODEM_SIM_2;
        SimStatus->SimPresent = TRUE;
        SimStatus->Pin1Status = Sim2Pin.PinStatus;
        Phone_Modem_Sim_Status_Ind(SimStatus);
        Phone_Modem_Pin_Status_Change_Ind(MMI_MODEM_SIM_1, Sim1Pin.PinStatus);
        Phone_Modem_Pin_Status_Change_Ind(MMI_MODEM_SIM_2, Sim2Pin.PinStatus);

        MMI_MODEM_PLMN_RAT rat1 = 0;
        MMI_MODEM_PLMN_RAT rat2 = 0;

        INT8 *Operator = (INT8 *)Hal_Mem_Alloc(strlen("CMCC") + 1);
        Hal_Mem_Copy(Operator, "CMCC", strlen("CMCC") + 1);
        Phone_Modem_Operator_Ind(MMI_MODEM_SIM_1, Operator, rat1);

        Operator = (INT8 *)Hal_Mem_Alloc(strlen("CUCC") + 1);
        Hal_Mem_Copy(Operator, "CUCC", strlen("CUCC") + 1);
        Phone_Modem_Operator_Ind(MMI_MODEM_SIM_2, Operator, rat2);

        Phone_Modem_Phonebook_Init_Ind(MMI_MODEM_SIM_1);
        Phone_Modem_Phonebook_Init_Ind(MMI_MODEM_SIM_2);
    }

#if 0
    if (DummyIdleTick > 2)
    {
        if ((DummyIdleTick % 10) > 5)
        {
            Phone_Modem_Signal_Bar_Ind(MMI_MODEM_SIM_1, MMI_MODEM_SIGNAL_BAR_4);
            Phone_Modem_Signal_Bar_Ind(MMI_MODEM_SIM_2, MMI_MODEM_SIGNAL_BAR_4);
        }
        else
        {
            Phone_Modem_Signal_Bar_Ind(MMI_MODEM_SIM_1, MMI_MODEM_SIGNAL_BAR_5);
            Phone_Modem_Signal_Bar_Ind(MMI_MODEM_SIM_2, MMI_MODEM_SIGNAL_BAR_5);
        }
    }
#endif
} /* Dummy_Idle_Tick_Timeout */

/**
 * power up SIMx request, used only when enable SIM.
 * modem should unset SIM disable status for next power up.
 * param (in) simId: MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Power_Up_Req(MMI_MODEM_SIM_ID simId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    DummyIdleTick = 0;
    UINT8 Para = 0;
    DummyIdleProc = Hal_Timer_Start(1000, Dummy_Idle_Tick_Timeout, (VOID *)&Para, TRUE);

    Hal_Mem_Copy(&(Sim1Pin.Pin1), "1234", 4);
    Hal_Mem_Copy(&(Sim1Pin.Pin2), "1234", 4);
    Hal_Mem_Copy(&(Sim1Pin.Puk1), "12345678", 8);
    Hal_Mem_Copy(&(Sim1Pin.Puk2), "12345678", 8);
    Sim1Pin.Pin1RetryLeft = 3;
    Sim1Pin.Pin2RetryLeft = 3;
    Sim1Pin.Puk1RetryLeft = 3;
    Sim1Pin.Puk2RetryLeft = 3;
    Sim1Pin.PinStatus     = MMI_MODEM_PIN_DISABLED;

    Hal_Mem_Copy(&(Sim2Pin.Pin1), "1234", 4);
    Hal_Mem_Copy(&(Sim2Pin.Pin2), "1234", 4);
    Hal_Mem_Copy(&(Sim2Pin.Puk1), "12345678", 8);
    Hal_Mem_Copy(&(Sim2Pin.Puk2), "12345678", 8);
    Sim2Pin.Pin1RetryLeft = 3;
    Sim2Pin.Pin2RetryLeft = 3;
    Sim2Pin.Puk1RetryLeft = 3;
    Sim2Pin.Puk2RetryLeft = 3;
    Sim2Pin.PinStatus     = MMI_MODEM_PIN_DISABLED;
}

/**
 * power off SIMx request, used when power off or SIM disable
 * modem should set the SIM disable status for next power up.
 * param (in) simId: MMI_MODEM_SIM_ID
 * param (in) PowerOffType: MMI_MODEM_POWER_OFF_TYPE
 * return  void
 */
VOID MMI_Modem_Power_Off_Req(MMI_MODEM_SIM_ID SimId, MMI_MODEM_POWER_OFF_TYPE PowerOffType)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    Hal_Timer_Stop(DummyIdleProc);
}

/**
 * Requests current call list ( AT+CLCC)
 * param (out) calls:  MMI_MODEM_CALL_REQUEST_GET_CURRENT_CALLS *
 * return  void
 */
VOID MMI_Modem_Call_Request_Get_Current_Calls(MMI_MODEM_SIM_ID simId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

UINT32 DummySecondCnt;

VOID dummy_1s_period(VOID* Para)
{
    DummySecondCnt++;
    MMI_Modem_Call_Response_Ccwa_t *Ccwa;
    MMI_Modem_Plmn_Search_Cnf_t    *PlmnSearchCnf = NULL;
    INT8                           PlmnName1[]    = "Soft Bank";// "CMCC";
    INT8                           PlmnName2[]    = "CUCC";
    INT8                           PlmnName3[]    = "CTCC";
    UINT8 *para = (UINT8*)Para;

    if (*para == 0)
    {   // for dail flow control
        if (2 == DummySecondCnt)
        {
            DummyIndex = 1;
            Phone_Modem_Call_Response_Originating(dummysimId, DummyIndex);
        }
        else if (3 == DummySecondCnt)
        {
            Phone_Modem_Call_Response_Alerting(dummysimId, DummyIndex);
        }
        else if (5 == DummySecondCnt)
        {
            Phone_Modem_Call_Response_Connect(dummysimId, DummyIndex);
            Hal_Timer_Stop(dummy_tm);
        }
    }
    else if (*para == 1)
    {   // for MT flow control
        if (2 == DummySecondCnt)
        {
            if (ccwa == 1)
            {
                DummyIndex = 2;
                Phone_Modem_Call_Response_Connect(dummysimId, DummyIndex);
            }
            else
            {
                Phone_Modem_Call_Response_Connect(dummysimId, DummyIndex);
            }

            Hal_Timer_Stop(dummy_tm);
        }
    }
    else if (*para == 2)
    {   // for MT reject
        if (2 == DummySecondCnt)
        {
            if (ccwa == 1)
            {
                DummyIndex = 2;
                Phone_Modem_Call_Response_No_Carrier(dummysimId, DummyIndex, 1);
                DummyIndex = 1;
                ccwa       = 0;
            }
            else
            {
                Phone_Modem_Call_Response_No_Carrier(dummysimId, DummyIndex, 1);
            }

            Hal_Timer_Stop(dummy_tm);
        }
    }
    else if (*para == 3)
    {   // for call waiting
        if (1 == DummySecondCnt)
        {
            Phone_Modem_Call_Response_Originating(dummysimId, DummyIndex);
        }
        else if (2 == DummySecondCnt)
        {
            Phone_Modem_Call_Response_Alerting(dummysimId, DummyIndex);
        }
        else if (3 == DummySecondCnt)
        {
            Phone_Modem_Call_Response_Connect(dummysimId, DummyIndex);
        }
        else if (6 == DummySecondCnt)
        {
            Ccwa =
                (MMI_Modem_Call_Response_Ccwa_t *)Hal_Mem_Alloc(sizeof(
                                                                    MMI_Modem_Call_Response_Ccwa_t));
            Ccwa->number = (INT8 *)Hal_Mem_Alloc(strlen("18641104110") + 1);
            Hal_Mem_Set(Ccwa->number, 0, strlen("18641104110") + 1);
            Hal_Mem_Copy(Ccwa->number, "18641104110", strlen("18641104110"));
            DummyIndex = 2;
            Phone_Modem_Call_Response_Ccwa(dummysimId, DummyIndex, Ccwa);
            Hal_Timer_Stop(dummy_tm);
        }
    }
    // add for setting UT begin
    else if (*para == 4)
    {   // setting call waiting
        if (2 == DummySecondCnt)
        {
            UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Query Sim1 call waitting status, return true\n");
            Phone_Modem_Call_Wait_Query_Cnf(MMI_MODEM_SIM_1, TRUE, MMI_MODEM_SUCCESS);
        }
        else if (3 == DummySecondCnt)
        {
            printf("Query Sim2 call waitting status, return false\n");
            Phone_Modem_Call_Wait_Query_Cnf(MMI_MODEM_SIM_2, FALSE, MMI_MODEM_ERROR);
            Hal_Timer_Stop(dummy_tm);
        }
    }
    else if (*para == 5)
    {   // sim1 list searching
        if (5 == DummySecondCnt)
        {
            PlmnSearchCnf = (MMI_Modem_Plmn_Search_Cnf_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Plmn_Search_Cnf_t));
            Hal_Mem_Set(PlmnSearchCnf, 0, sizeof(MMI_Modem_Plmn_Search_Cnf_t));

            PlmnSearchCnf->simId   = MMI_MODEM_SIM_1;
            PlmnSearchCnf->PlmnCnt = 3;

            PlmnSearchCnf->PlmnList = (MMI_Modem_PLMN_Info *)Hal_Mem_Alloc(sizeof(MMI_Modem_PLMN_Info) * 3);
            Hal_Mem_Set(PlmnSearchCnf->PlmnList, 0, sizeof(MMI_Modem_PLMN_Info) * 3);
            strcpy(PlmnSearchCnf->PlmnList[0].PlmnName,PlmnName1);
            strcpy(PlmnSearchCnf->PlmnList[1].PlmnName,PlmnName2);
            strcpy(PlmnSearchCnf->PlmnList[2].PlmnName,PlmnName3);

            Phone_Modem_Plmn_Search_Cnf(PlmnSearchCnf);
            Hal_Timer_Stop(dummy_tm);
        }
    }
    else if (*para == 6)
    {   // sim1 spec searching
        if (10 == DummySecondCnt)
        {
            PlmnSearchCnf = (MMI_Modem_Plmn_Search_Cnf_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Plmn_Search_Cnf_t));
            Hal_Mem_Set(PlmnSearchCnf, 0, sizeof(MMI_Modem_Plmn_Search_Cnf_t));

            PlmnSearchCnf->simId    = MMI_MODEM_SIM_1;
            PlmnSearchCnf->PlmnCnt  = 1;
            PlmnSearchCnf->PlmnList = (MMI_Modem_PLMN_Info *)Hal_Mem_Alloc(sizeof(MMI_Modem_PLMN_Info));
            Hal_Mem_Set(PlmnSearchCnf->PlmnList, 0, sizeof(MMI_Modem_PLMN_Info));
            strcpy(PlmnSearchCnf->PlmnList->PlmnName,PlmnName1);

            Phone_Modem_Plmn_Search_Cnf(PlmnSearchCnf);
            Hal_Timer_Stop(dummy_tm);
        }
    }
    else if (*para == 7)
    {   // sim2 list searching
        PlmnSearchCnf = (MMI_Modem_Plmn_Search_Cnf_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Plmn_Search_Cnf_t));
        Hal_Mem_Set(PlmnSearchCnf, 0, sizeof(MMI_Modem_Plmn_Search_Cnf_t));

        PlmnSearchCnf->simId   = MMI_MODEM_SIM_2;
        PlmnSearchCnf->PlmnCnt = 0;
        Phone_Modem_Plmn_Search_Cnf(PlmnSearchCnf);
        Hal_Timer_Stop(dummy_tm);
    }
    // add for setting UT end
} /* dummy_1s_period */

/**
 * Initiate voice call ( ATD<dial string>{} or AT*DIALE=<dial string>,<service Type>)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) number:  phone number to dial
 * return  void
 */
VOID MMI_Modem_Call_Request_Dial(MMI_MODEM_SIM_ID simId, INT8 *number,
                                 MMI_MODEM_CALL_SERVICE_TYPE ServiceType)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (strncmp(number, "10086", 5))
    {   // not 10086, mo call
        dummysimId     = simId;
        DummySecondCnt = 0;
        ccwa           = 0;
        static UINT8 Para = 0;
        dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
        Hal_Mem_Free(number);
        DummyIndex = MMI_MODEM_CALL_INVALID_INDEX;
    }
    else
    {   // call waiting accept
        dummysimId     = simId;
        DummySecondCnt = 0;
        ccwa           = 1;
        DummyIndex     = 1;
        static UINT8 Para = 3;
        dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
        Hal_Mem_Free(number);
    }
}

/**
 * Hang up a specific line (like AT+CHLD=1x)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) index:   Connection index (value of 'x' in CHLD above)
 * return  void
 */
VOID MMI_Modem_Call_Request_Hangup(MMI_MODEM_SIM_ID simId, int index)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    Phone_Modem_Call_Response_No_Carrier(simId, index, 1);
}

/**
 * Hang up waiting or held (like AT+CHLD=0)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Call_Request_Hangup_Waiting_Or_Background(MMI_MODEM_SIM_ID simId)
{
    MMI_Modem_Call_t                       *CallInfo;
    MMI_Modem_Call_Response_State_Change_t *StateChange;

    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (ccwa == 0)
    {
        Phone_Modem_Call_Response_No_Carrier(simId, DummyIndex, 1);
    }
    else
    {
        StateChange =
            (MMI_Modem_Call_Response_State_Change_t *)Hal_Mem_Alloc(sizeof(
                                                                        MMI_Modem_Call_Response_State_Change_t));

        StateChange->count = 1;
        CallInfo           = (MMI_Modem_Call_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Call_t) * StateChange->count);
        StateChange->calls = CallInfo;
        CallInfo[0].state  = MMI_MODEM_CALL_STATE_ACTIVE;

        CallInfo[0].simId = simId;
        if (1 == DummyIndex)
        {
            CallInfo[0].index = 2;
        }
        else if (2 == DummyIndex)
        {
            CallInfo[0].index = 1;
        }

        Phone_Modem_Call_Response_No_Carrier(simId, DummyIndex, 1);
        DummyIndex = CallInfo[0].index;
        Phone_Modem_Call_Response_State_Change(StateChange);
        // one disconnect reset ccwa flag and sawpflg
        ccwa    = 0;
        swapflg = 0;
    }
}

/**
 * Hang up active, and resume waiting or held (like AT+CHLD=1)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Call_Request_Hangup_Foreground_Resume_Background(MMI_MODEM_SIM_ID simId)
{
    MMI_Modem_Call_t                       *CallInfo;
    MMI_Modem_Call_Response_State_Change_t *StateChange;

    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s sim id %d\n", __FUNCTION__,simId);

    if (ccwa == 0)
    {
        Phone_Modem_Call_Response_No_Carrier(simId, DummyIndex, 1);
    }
    else
    {
        StateChange =
            (MMI_Modem_Call_Response_State_Change_t *)Hal_Mem_Alloc(sizeof(
                                                                        MMI_Modem_Call_Response_State_Change_t));

        StateChange->count = 1;
        CallInfo           = (MMI_Modem_Call_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Call_t) * StateChange->count);
        StateChange->calls = CallInfo;
        CallInfo[0].state  = MMI_MODEM_CALL_STATE_ACTIVE;

        CallInfo[0].simId = simId;
        if (1 == DummyIndex)
        {
            CallInfo[0].index = 2;
        }
        else if (2 == DummyIndex)
        {
            CallInfo[0].index = 1;
        }

        Phone_Modem_Call_Response_No_Carrier(simId, DummyIndex, 1);
        DummyIndex = CallInfo[0].index;
        Phone_Modem_Call_Response_State_Change(StateChange);
        // one disconnect reset ccwa flag and sawpflg
        ccwa    = 0;
        swapflg = 0;
    }
}

/*
 * Switch waiting or holding call and active call (like AT+CHLD=2)
 *
 * State transitions should be is follows:
 *
 * If call 1 is waiting and call 2 is active, then if this re
 *
 *   BEFORE                               AFTER
 * Call 1   Call 2                 Call 1       Call 2
 * ACTIVE   HOLDING                HOLDING     ACTIVE
 * ACTIVE   WAITING                HOLDING     ACTIVE
 * HOLDING  WAITING                HOLDING     ACTIVE
 * ACTIVE   IDLE                   HOLDING     IDLE
 * IDLE     IDLE                   IDLE        IDLE
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Call_Request_Switch_Waiting_Or_Holding_And_Active(MMI_MODEM_SIM_ID simId)
{
    MMI_Modem_Call_t                       *CallInfo;
    MMI_Modem_Call_Response_State_Change_t *StateChange;

    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);

    StateChange =
        (MMI_Modem_Call_Response_State_Change_t *)Hal_Mem_Alloc(sizeof(
                                                                    MMI_Modem_Call_Response_State_Change_t));

    if (ccwa == 0)
    {
        StateChange->count = 1;
        CallInfo           = (MMI_Modem_Call_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Call_t) * StateChange->count);
        StateChange->calls = CallInfo;
        UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "swapflg is %d\n", swapflg);
        if (0 == (swapflg % 2))
        {
            CallInfo[0].state = MMI_MODEM_CALL_STATE_HOLDING;
            UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "call state: %s\n","MMI_MODEM_CALL_STATE_HOLDING");
        }
        else
        {
            CallInfo[0].state = MMI_MODEM_CALL_STATE_ACTIVE;
            UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "call state: %s\n","MMI_MODEM_CALL_STATE_ACTIVE");
        }

        CallInfo[0].simId = simId;
        CallInfo[0].index = DummyIndex;
        Phone_Modem_Call_Response_State_Change(StateChange);
    }
    else
    {
        StateChange->count = 2;
        CallInfo           = (MMI_Modem_Call_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Call_t) * StateChange->count);
        StateChange->calls = CallInfo;
        if (0 == (swapflg % 2))
        {
            CallInfo[0].state = MMI_MODEM_CALL_STATE_HOLDING;
            CallInfo[1].state = MMI_MODEM_CALL_STATE_ACTIVE;
            DummyIndex        = 2;
            UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "call1 state: %s\n","MMI_MODEM_CALL_STATE_HOLDING");
            UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "call2 state: %s\n","MMI_MODEM_CALL_STATE_ACTIVE");
        }
        else
        {
            CallInfo[0].state = MMI_MODEM_CALL_STATE_ACTIVE;
            CallInfo[1].state = MMI_MODEM_CALL_STATE_HOLDING;
            DummyIndex        = 1;
            UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "call1 state: %s\n","MMI_MODEM_CALL_STATE_ACTIVE");
            UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "call2 state: %s\n","MMI_MODEM_CALL_STATE_HOLDING");
        }

        CallInfo[0].simId = simId;
        CallInfo[0].index = 1;
        CallInfo[1].simId = simId;
        CallInfo[1].index = 2;
        Phone_Modem_Call_Response_State_Change(StateChange);
    }
    swapflg++;
    if (swapflg > 2)
    {
        swapflg = 1;
    }
} /* MMI_Modem_Call_Request_Switch_Waiting_Or_Holding_And_Active */

/**
 * Conference holding and active (like AT+CHLD=3)
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Call_Request_Conference(MMI_MODEM_SIM_ID simId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * Separate a party from a multiparty call placing the multiparty call
 * (less the specified party) on hold and leaving the specified party
 * as the only other member of the current (active) call
 *
 * Like AT+CHLD=2x
 *
 * See TS 22.084 1.3.8.2 (iii)
 * TS 22.030 6.5.5 "Entering "2X followed by send"
 * TS 27.007 "AT+CHLD=2x"
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) index:   Connection index (value of 'x' in CHLD above)
 * return  void
 */
VOID MMI_Modem_Call_Request_Separate_Connection(MMI_MODEM_SIM_ID simId, int index)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * Connects the two calls and disconnects the subscriber from both calls (ECT). (AT+CHLD=4)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Call_Request_Explicit_Call_Transfer(MMI_MODEM_SIM_ID simId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * Send UDUB (user determined user busy) to ringing or
 * waiting call answer  (AT+CHLD=0)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Call_Request_Udub(MMI_MODEM_SIM_ID simId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    DummySecondCnt = 0;
    DummyIndex     = 1;
    static UINT8 Para = 2;
    dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
}

/**
 * Answer incoming call (ATA)
 *
 * Will not be called for WAITING calls.
 * RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE will be used in this case instead
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Call_Request_Answer(MMI_MODEM_SIM_ID simId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    dummysimId     = simId;
    DummySecondCnt = 0;
    static UINT8 Para = 1;
    dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
    DummyIndex = 1;
}

/**
 * Send a DTMF tone (AT+VTS=<DTMF>)
 *
 * If the implementation is currently playing a tone requested via
 * RIL_REQUEST_DTMF_START, that tone should be cancelled and the new tone
 * should be played instead
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) dtmf:  MMI_MODEM_CALL_REQUEST_DTMF *
 * return  void
 */
VOID MMI_Modem_Call_Request_Dtmf(MMI_MODEM_SIM_ID simId, MMI_Modem_Call_Request_Dtmf_t *dtmf)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * Start playing a DTMF tone. Continue playing DTMF tone until
 * RIL_REQUEST_DTMF_STOP is received (AT+VTS=<DTMF>)
 *
 * If a RIL_REQUEST_DTMF_START is received while a tone is currently playing,
 * it should cancel the previous tone and play the new one.
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) dtmf: a single character with one of 12 values: 0-9,*,#
 * return  void
 */
VOID MMI_Modem_Call_Request_Dtmf_Start(MMI_MODEM_SIM_ID simId, INT8 dtmf)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * Stop playing a currently playing DTMF tone. (AT)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Call_Request_Dtmf_stop(MMI_MODEM_SIM_ID simId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * Turn on or off uplink (microphone) mute. ("AT+CMUT=<n>)
 *
 * Will only be sent while voice call is active.
 * Will always be reset to "disable mute" when a new voice call is initiated
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) mute:   TRUE for "enable mute" and FALSE for "disable mute"
 * return  void
 */
VOID MMI_Modem_Call_Request_Set_Mute(MMI_MODEM_SIM_ID simId, BOOL mute)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * Queries the current state of the uplink mute setting (AT+CMUT?)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (out) mute:   1 for "mute enabled" and 0 for "mute disabled"
 * return  void
 */
VOID MMI_Modem_Call_Request_Get_Mute(MMI_MODEM_SIM_ID simId, int *mute)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * Gets IMEI (#*06#)
 *
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (out) imei:  IMEI
 * return  void
 */
VOID MMI_Modem_Call_Request_Imei(MMI_MODEM_SIM_ID simId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * enable PIN lock
 * param (in) PinLockSet:  MMI_Modem_Pin_Lock_t*
 * return  void
 */
VOID  MMI_Modem_Enable_Pin_Lock(MMI_Modem_Pin_Lock_t *PinLockSet, INT8 *PIN)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (PinLockSet->SimId == MMI_MODEM_SIM_1)
    {
        if (0 == strncmp(PIN, Sim1Pin.Pin1, 4))
        {
            if (TRUE == PinLockSet->PinEnable)
            {
                Sim1Pin.PinStatus = MMI_MODEM_PIN1_REQUIRED;
            }
            else
            {
                Sim1Pin.PinStatus = MMI_MODEM_PIN_DISABLED;
            }

            PinLockSet->RetriesLeft = MMI_MODEM_PIN_CHECK_OK;
        }
        else
        {
            Sim1Pin.Pin1RetryLeft--;

            if (0 == Sim1Pin.Pin1RetryLeft)
            {
                Sim1Pin.PinStatus = MMI_MODEM_PIN1_BLOCKED_PUK1_REQUIRED;
            }
            PinLockSet->RetriesLeft = Sim1Pin.Pin1RetryLeft;
        }
    }

    if (PinLockSet->SimId == MMI_MODEM_SIM_2)
    {
        if (0 == strncmp(PIN, Sim2Pin.Pin1, 4))
        {
            if (TRUE == PinLockSet->PinEnable)
            {
                Sim2Pin.PinStatus = MMI_MODEM_PIN1_REQUIRED;
            }
            else
            {
                Sim2Pin.PinStatus = MMI_MODEM_PIN_DISABLED;
            }

            PinLockSet->RetriesLeft = MMI_MODEM_PIN_CHECK_OK;
        }
        else
        {
            Sim2Pin.Pin1RetryLeft--;

            if (0 == Sim2Pin.Pin1RetryLeft)
            {
                Sim2Pin.PinStatus = MMI_MODEM_PIN1_BLOCKED_PUK1_REQUIRED;
            }
            PinLockSet->RetriesLeft = Sim2Pin.Pin1RetryLeft;
        }
    }
} /* MMI_Modem_Enable_Pin_Lock */

/**
 * Request modem adpter to try PIN code
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) PIN:  INT8*
 * return  UINT8: Retry Left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
UINT8 MMI_Modem_Try_Pin_Req(MMI_MODEM_SIM_ID SimId, INT8 *PIN)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (SimId == MMI_MODEM_SIM_1)
    {
        if (0 == strncmp(PIN, Sim1Pin.Pin1, 4))
        {
            Sim1Pin.Pin1RetryLeft = 3;
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim1Pin.Pin1RetryLeft--;
            Sim1Pin.PinStatus = MMI_MODEM_PIN1_REQUIRED;
            // if (0 == Sim1Pin.Pin1RetryLeft)
            // {
            // Sim1Pin.PinStatus = MMI_MODEM_PIN1_BLOCKED_PUK1_REQUIRED;
            // }
            return(Sim1Pin.Pin1RetryLeft);
        }
    }

    if (SimId == MMI_MODEM_SIM_2)
    {
        if (0 == strncmp(PIN, Sim2Pin.Pin1, 4))
        {
            Sim2Pin.Pin1RetryLeft = 3;
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim2Pin.Pin1RetryLeft--;
            Sim2Pin.PinStatus = MMI_MODEM_PIN1_REQUIRED;
            // if (0 == Sim2Pin.Pin1RetryLeft)
            // {
            // Sim2Pin.PinStatus = MMI_MODEM_PIN1_BLOCKED_PUK1_REQUIRED;
            // }
            return(Sim2Pin.Pin1RetryLeft);
        }
    }

    return(0);
} /* MMI_Modem_Try_Pin_Req */

/**
 * Request modem adpter to try PIN2 code
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) PIN2:  INT8*
 * return UINT8: retry left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
UINT8 MMI_Modem_Try_Pin2_Req(MMI_MODEM_SIM_ID SimId, INT8 *PIN2)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (SimId == MMI_MODEM_SIM_1)
    {
        if (0 == strncmp(PIN2, Sim1Pin.Pin2, 4))
        {
            Sim1Pin.Pin2RetryLeft = 3;
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim1Pin.Pin2RetryLeft--;
            Sim1Pin.PinStatus = MMI_MODEM_PIN2_REQUIRED;
            // if (0 == Sim1Pin.Pin2RetryLeft)
            // {
            // Sim1Pin.PinStatus = MMI_MODEM_PIN2_BLOCKED_PUK2_REQUIRED;
            // }
            return(Sim1Pin.Pin2RetryLeft);
        }
    }

    if (SimId == MMI_MODEM_SIM_2)
    {
        if (0 == strncmp(PIN2, Sim2Pin.Pin2, 4))
        {
            Sim2Pin.Pin2RetryLeft = 3;
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim2Pin.Pin2RetryLeft--;
            Sim2Pin.PinStatus = MMI_MODEM_PIN2_REQUIRED;
            // if (0 == Sim2Pin.Pin2RetryLeft)
            // {
            // Sim2Pin.PinStatus = MMI_MODEM_PIN2_BLOCKED_PUK2_REQUIRED;
            // }
            return(Sim2Pin.Pin2RetryLeft);
        }
    }
    return(0);
} /* MMI_Modem_Try_Pin2_Req */

/**
 * Request modem adpter to try PUK code
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) PUK:  INT8*
 * return  UINT8: Retry Left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
UINT8 MMI_Modem_Try_Puk_Req(MMI_MODEM_SIM_ID SimId, INT8 *PUK, INT8 *NewPIN)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);

    if (SimId == MMI_MODEM_SIM_1)
    {
        if (0 == strncmp(PUK, Sim1Pin.Puk1, 8))
        {
            Sim1Pin.Puk1RetryLeft = 3;
            Sim1Pin.Pin1RetryLeft = 3;
            Hal_Mem_Copy(&(Sim1Pin.Pin1), NewPIN, 4);
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim1Pin.Puk1RetryLeft--;
            if (0 == Sim1Pin.Puk1RetryLeft)
            {
                Sim1Pin.PinStatus = MMI_MODEM_PUK1_BLOCKED;
            }
            return(Sim1Pin.Puk1RetryLeft);
        }
    }

    if (SimId == MMI_MODEM_SIM_2)
    {
        if (0 == strncmp(PUK, Sim2Pin.Puk1, 8))
        {
            Sim2Pin.Puk1RetryLeft = 3;
            Sim2Pin.Pin1RetryLeft = 3;
            Hal_Mem_Copy(&(Sim1Pin.Pin1), NewPIN, 4);
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim2Pin.Puk1RetryLeft--;
            if (0 == Sim2Pin.Puk1RetryLeft)
            {
                Sim2Pin.PinStatus = MMI_MODEM_PUK1_BLOCKED;
            }
            return(Sim2Pin.Puk1RetryLeft);
        }
    }

    return(0);
} /* MMI_Modem_Try_Puk_Req */

/**
 * Request modem adpter to try PUK2 code
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) PUK2:  INT8*
 * return UINT8: retry left: MMI_MODEM_PIN_CHECK_OK when check OK
 */
UINT8 MMI_Modem_Try_Puk2_Req(MMI_MODEM_SIM_ID SimId, INT8 *PUK2, INT8 *NewPIN2)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (SimId == MMI_MODEM_SIM_1)
    {
        if (0 == strncmp(PUK2, Sim1Pin.Puk2, 8))
        {
            Sim1Pin.Puk2RetryLeft = 3;
            Sim1Pin.Pin2RetryLeft = 3;
            Hal_Mem_Copy(&(Sim1Pin.Pin2), NewPIN2, 4);
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim1Pin.Puk2RetryLeft--;
            if (0 == Sim1Pin.Puk2RetryLeft)
            {
                Sim1Pin.PinStatus = MMI_MODEM_PUK2_BLOCKED;
            }
            return(Sim1Pin.Puk2RetryLeft);
        }
    }

    if (SimId == MMI_MODEM_SIM_2)
    {
        if (0 == strncmp(PUK2, Sim2Pin.Puk2, 8))
        {
            Sim2Pin.Puk2RetryLeft = 3;
            Sim2Pin.Pin2RetryLeft = 3;
            Hal_Mem_Copy(&(Sim1Pin.Pin2), NewPIN2, 4);
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim2Pin.Puk2RetryLeft--;
            if (0 == Sim2Pin.Puk2RetryLeft)
            {
                Sim2Pin.PinStatus = MMI_MODEM_PUK2_BLOCKED;
            }
            return(Sim2Pin.Puk2RetryLeft);
        }
    }

    return(0);
} /* MMI_Modem_Try_Puk2_Req */

/**
 * Request modem adpter to change PIN code
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) PIN:  INT8*
 * return void
 */
UINT8 MMI_Modem_Change_Pin_Req(MMI_MODEM_SIM_ID SimId, INT8 *PIN, INT8 *OldPIN)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (SimId == MMI_MODEM_SIM_1)
    {
        if (0 == strncmp(OldPIN, Sim1Pin.Pin1, 4))
        {
            Sim1Pin.Pin1RetryLeft = 3;
            Hal_Mem_Copy(&(Sim1Pin.Pin1), PIN, 4);
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim1Pin.Pin1RetryLeft--;
            Sim1Pin.PinStatus = MMI_MODEM_PIN1_REQUIRED;
            // if (0 == Sim1Pin.Pin1RetryLeft)
            // {
            // Sim1Pin.PinStatus = MMI_MODEM_PIN1_BLOCKED_PUK1_REQUIRED;
            // }
            return(Sim1Pin.Pin1RetryLeft);
        }
    }

    if (SimId == MMI_MODEM_SIM_2)
    {
        if (0 == strncmp(OldPIN, Sim2Pin.Pin1, 4))
        {
            Sim2Pin.Pin1RetryLeft = 3;
            Hal_Mem_Copy(&(Sim2Pin.Pin1), PIN, 4);
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim2Pin.Pin1RetryLeft--;
            Sim2Pin.PinStatus = MMI_MODEM_PIN1_REQUIRED;
            // if (0 == Sim2Pin.Pin1RetryLeft)
            // {
            // Sim2Pin.PinStatus = MMI_MODEM_PIN1_BLOCKED_PUK1_REQUIRED;
            // }
            return(Sim2Pin.Pin1RetryLeft);
        }
    }

    return(0);
} /* MMI_Modem_Change_Pin_Req */

/**
 * Request modem adpter to change PIN2 code
 * param (in) simId:  MMI_MODEM_SIM_ID
 * param (in) PIN2:  INT8*
 * return void
 */
UINT8 MMI_Modem_Change_Pin2_Req(MMI_MODEM_SIM_ID SimId, INT8 *PIN2, INT8 *OldPIN2)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (SimId == MMI_MODEM_SIM_1)
    {
        if (0 == strncmp(OldPIN2, Sim1Pin.Pin2, 4))
        {
            Sim1Pin.Pin2RetryLeft = 3;
            Hal_Mem_Copy(&(Sim1Pin.Pin2), PIN2, 4);
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim1Pin.Pin2RetryLeft--;
            Sim1Pin.PinStatus = MMI_MODEM_PIN2_REQUIRED;
            // if (0 == Sim1Pin.Pin2RetryLeft)
            // {
            // Sim1Pin.PinStatus = MMI_MODEM_PIN2_BLOCKED_PUK2_REQUIRED;
            // }
            return(Sim1Pin.Pin2RetryLeft);
        }
    }

    if (SimId == MMI_MODEM_SIM_2)
    {
        if (0 == strncmp(OldPIN2, Sim2Pin.Pin2, 4))
        {
            Sim2Pin.Pin2RetryLeft = 3;
            Hal_Mem_Copy(&(Sim2Pin.Pin2), PIN2, 4);
            return(MMI_MODEM_PIN_CHECK_OK);
        }
        else
        {
            Sim2Pin.Pin2RetryLeft--;
            Sim2Pin.PinStatus = MMI_MODEM_PIN2_REQUIRED;
            // if (0 == Sim2Pin.Pin2RetryLeft)
            // {
            // Sim2Pin.PinStatus = MMI_MODEM_PIN2_BLOCKED_PUK2_REQUIRED;
            // }
            return(Sim2Pin.Pin2RetryLeft);
        }
    }

    return(0);
} /* MMI_Modem_Change_Pin2_Req */

/**
 * Request modem adpter to search plmn
 * param (in) PlmnSearchReq: MMI_Modem_Plmn_Search_Req_t
 * return void
 */
VOID MMI_Modem_Plmn_Search_Req(MMI_Modem_Plmn_Search_Req_t *PlmnSearchReq)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (MMI_MODEM_PLMN_SEARCH_AUTO != PlmnSearchReq->SearchType)
    {
        if (MMI_MODEM_SIM_1 == PlmnSearchReq->simId)
        {
            if (MMI_MODEM_PLMN_SEARCH_LIST == PlmnSearchReq->SearchType)
            {
                UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Sim1 recived MMI_Modem_Plmn_Search_Req(List)\n");
                UINT8 Para = 5;
                dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
            }
            else
            {
                UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Sim1 recived MMI_Modem_Plmn_Search_Req(Spec)\n");
                UINT8 Para = 6;
                dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
            }
        }
        else
        {
            if (MMI_MODEM_PLMN_SEARCH_LIST == PlmnSearchReq->SearchType)
            {
                UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Sim2 recived MMI_Modem_Plmn_Search_Req(List)\n");
                UINT8 Para = 7;
                dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
            }
            else
            {
                UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Sim2 recived MMI_Modem_Plmn_Search_Req(Spec)\n");
                UINT8 Para = 8;
                dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
            }
        }
    }
}

/**
 * plmn search confirm
 * param void:
 * return void:
 */
VOID MMI_Modem_Plmn_Search_Stop_Req(VOID)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Recived MMI_Modem_Plmn_Search_Stop_Req\n");
    Hal_Timer_Stop(dummy_tm);
}

/**
 * configure SS service call wait
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) CallForwardInfo : MMI_Modem_Call_Forward_Info_t
 * return void:
 */
VOID MMI_Modem_Call_Forward_Set_Req(MMI_MODEM_SIM_ID              SimId,
                                    MMI_Modem_Call_Forward_Info_t *CallForwardInfo)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (MMI_MODEM_SIM_1 == SimId)
    {
        UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Sim1 recived MMI_Modem_Call_Forward_Set_Req, return succcess\n");
        Phone_Modem_Call_Forward_Set_Cnf(SimId, MMI_MODEM_SUCCESS);
    }
    else
    {
        UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Sim2 recived MMI_Modem_Call_Forward_Set_Req, return error\n");
        Phone_Modem_Call_Forward_Set_Cnf(SimId, MMI_MODEM_ERROR);
    }
}

/**
 * configure SS service call wait
 * param (in) SimId : MMI_MODEM_SIM_ID
 * param (in) CallWaitOn : BOOL (true means call wait on)
 * return void:
 */
VOID MMI_Modem_Call_Wait_Set_Req(MMI_MODEM_SIM_ID SimId, BOOL CallWaitOn)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    if (MMI_MODEM_SIM_1 == SimId)
    {
        UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Sim1 recived MMI_Modem_Call_Wait_Set_Req, return succcess\n");
        Phone_Modem_Call_Wait_Set_Cnf(SimId, MMI_MODEM_SUCCESS);
    }
    else
    {
        UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "Sim2 recived MMI_Modem_Call_Wait_Set_Req, return error\n");
        Phone_Modem_Call_Wait_Set_Cnf(SimId, MMI_MODEM_ERROR);
    }
}

/**
 * query SS service call wait
 * param (in) SimId : MMI_MODEM_SIM_ID
 * return void
 */
VOID MMI_Modem_Call_Wait_Query_Req(MMI_MODEM_SIM_ID SimId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    static UINT8 Para = 4;
    dummy_tm       = Hal_Timer_Start(1000, dummy_1s_period, (VOID *)&Para, TRUE);
}

/**
 * get Operator(short name)
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Operator: char*
 * return  void
 */
VOID MMI_Modem_Get_Operator_Req(MMI_MODEM_SIM_ID SimId, char *Operator, MMI_MODEM_PLMN_RAT *Rat)
{
    INT8 Cmcc[] = "CMCC";
    INT8 Cucc[] = "CUCC";

    if (MMI_MODEM_SIM_1 == SimId)
    {
        Hal_Mem_Copy(Operator, Cmcc, sizeof(Cmcc));
    }

    if (MMI_MODEM_SIM_2 == SimId)
    {
        Hal_Mem_Copy(Operator, Cucc, sizeof(Cucc));
    }

    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/**
 * check whether sim is present.
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  BOOL: ture means sim present
 */
BOOL MMI_Modem_Sim_Present_Check_Req(MMI_MODEM_SIM_ID simId)
{
    UINT8 Ret = TRUE;

    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);

    if (MMI_MODEM_SIM_1 == simId)
    {
        Ret = TRUE;
    }

    if (MMI_MODEM_SIM_2 == simId)
    {
        Ret = TRUE;
    }

    return(Ret);
}

/**
 * Request CP phone book status
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Get_Phonebook_Status_Req(MMI_MODEM_SIM_ID SimId)
{
    MMI_Modem_Phonebook_Status *PhkStatus;

    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);

    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "MMI_Modem_Get_Phonebook_Status_Req, SIM %d\n", SimId);

    PhkStatus        = (MMI_Modem_Phonebook_Status *)Hal_Mem_Alloc(sizeof(MMI_Modem_Phonebook_Status));
    PhkStatus->total = 500;
    PhkStatus->used  = 0;
    Phone_Modem_Get_Phonebook_Status_Cnf(SimId, PhkStatus);
}

static TIMER_ID         WriteTimerId;
static MMI_MODEM_SIM_ID PbSimId;

VOID MMI_Modem_Write_PB_Timeout(VOID* Para)
{
    static UINT16 Index = 0;

    UINT32* ContactIndex = (UINT32*)Para;

    if (MMI_MODEM_CONTACT_INDEX_INVALID == *ContactIndex)
    {
        Phone_Modem_Write_Phonebook_Cnf(PbSimId, Index++);
    }
    else
    {
        Phone_Modem_Write_Phonebook_Cnf(PbSimId, *ContactIndex);
    }
}

/**
 * Request to write new contact into phone book
 * param (in) SimId: MMI_MODEM_SIM_ID
 * param (in) Contact: MMI_Modem_Contact*, delete if name is invalid, write to the first free location if index is invalid
 * return  void
 */
VOID MMI_Modem_Write_Phonebook_Req(MMI_MODEM_SIM_ID SimId, MMI_Modem_Contact *Contact)
{
    static UINT16 ContactIndex;

    ContactIndex = Contact->Index;

    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);

    Hal_Mem_Free(Contact);

    PbSimId      = SimId;
    WriteTimerId = Hal_Timer_Start(1000, MMI_Modem_Write_PB_Timeout, (VOID *)&ContactIndex, FALSE);
}

/**
 * Request to read all of contacts from phone book
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Read_Phonebook_Req(MMI_MODEM_SIM_ID SimId, UINT16 Used, UINT16 FirstIndex)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

/*
 * Request current voice registration state
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  UINT8: MMI_MODEM_VOICE_REG_STATE
 */
UINT8 MMI_Modem_Voice_Registration_State_Req(MMI_MODEM_SIM_ID SimId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
    return(MMI_MODEM_VOICE_NORMAL);
}
UINT32 SendSmsCnt = 0;
TIMER_ID                     Timerid;
MMI_Modem_Send_Sms_Cnf_t *pSendSmsCnf = NULL;

/**
 * send new sms req
 * param (in) pSendSms: MMI_Modem_Send_Sms_Req_t
 * return  void
 */
VOID MMI_Modem_Send_Sms_timeout(VOID* id)
{
    MMI_MODEM_SIM_ID *pSimId = (MMI_MODEM_SIM_ID*)id;
    pSendSmsCnf = (MMI_Modem_Send_Sms_Cnf_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Send_Sms_Cnf_t));
    Hal_Mem_Set(pSendSmsCnf,0,sizeof(MMI_Modem_Send_Sms_Cnf_t));
    pSendSmsCnf->Result = MMI_MODEM_SMS_SUCCESS;
    pSendSmsCnf->MsgIndex = SendSmsCnt++;
    pSendSmsCnf->SimId = *pSimId;
    Phone_Modem_Send_Sms_Cnf(pSendSmsCnf);
    printf("%s\n", __FUNCTION__);
}
/**
 * send new sms req
 * param (in) pSendSms: MMI_Modem_Send_Sms_Req_t
 * return  void
 */
VOID MMI_Modem_Send_Sms_Req(MMI_Modem_Send_Sms_Req_t *pSendSms)
{
    Timerid = Hal_Timer_Start(1000, MMI_Modem_Send_Sms_timeout, (VOID *)&pSendSms->SimId, FALSE);

    Hal_Mem_Free(pSendSms->pSmsc);
    pSendSms->pSmsc = NULL;
    Hal_Mem_Free(pSendSms->pSmsPdu);
    pSendSms->pSmsPdu = NULL;
    Hal_Mem_Free(pSendSms);
    printf("%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}


/**
 * delete sms req
 * param (in) pDeleteSms: MMI_Modem_Delete_Sms_Req_t
 * return  void
 */
VOID MMI_Modem_Delete_Sms_Req(MMI_Modem_Delete_Sms_Req_t *pDeleteSms)
{
#if MMI_MODEM_SMS_STORE_IN_FILE != 0
    MMI_Modem_Sms_File_Delete_Sms_req(pDeleteSms);
#endif

    Phone_Modem_Delete_Sms_Cnf(MMI_MODEM_SMS_SUCCESS);

    Hal_Mem_Free(pDeleteSms);
    printf("%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}



/**
 * read sms info req
 * param (in) SmsBox: MMI_MODEM_SMS_OF_BOX
 * return  void
 */
VOID MMI_Modem_Read_Sms_Info_Req(MMI_MODEM_SMS_OF_BOX SmsBox)
{
#if 0
    MMI_Modem_Read_Sms_Info_Cnf_t *pReadSmsInfoCnf = NULL;
    pReadSmsInfoCnf = (MMI_Modem_Read_Sms_Info_Cnf_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Read_Sms_Info_Cnf_t));
    Hal_Mem_Set(pReadSmsInfoCnf,0,sizeof(MMI_Modem_Read_Sms_Info_Cnf_t));
    pReadSmsInfoCnf->SmsBox = SmsBox;
    pReadSmsInfoCnf->Result = MMI_MODEM_SMS_SUCCESS;
    if(MMI_MODEM_SMS_RECEIVED == SmsBox)
    {
        pReadSmsInfoCnf->ReadMsgCnt = 3;
        pReadSmsInfoCnf->pMsgContentInfo = (MMI_Modem_Msg_Content_Info_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Msg_Content_Info_t) * 3);
        pReadSmsInfoCnf->pMsgContentInfo[0].MsgIndex = 12;
        pReadSmsInfoCnf->pMsgContentInfo[0].SimId = MMI_MODEM_SIM_1;
        pReadSmsInfoCnf->pMsgContentInfo[0].ReadSmsType = MMI_MODEM_UNREAD;
        pReadSmsInfoCnf->pMsgContentInfo[1].MsgIndex = 13;
        pReadSmsInfoCnf->pMsgContentInfo[1].SimId = MMI_MODEM_SIM_1;
        pReadSmsInfoCnf->pMsgContentInfo[1].ReadSmsType = MMI_MODEM_READ;
        pReadSmsInfoCnf->pMsgContentInfo[2].MsgIndex = 15;
        pReadSmsInfoCnf->pMsgContentInfo[2].SimId = MMI_MODEM_SIM_2;
        pReadSmsInfoCnf->pMsgContentInfo[2].ReadSmsType = MMI_MODEM_READ;
    }
    else if(MMI_MODEM_SMS_SENT == SmsBox)
    {
        pReadSmsInfoCnf->ReadMsgCnt = 3;
        pReadSmsInfoCnf->pMsgContentInfo = (MMI_Modem_Msg_Content_Info_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Msg_Content_Info_t) * 3);
        pReadSmsInfoCnf->pMsgContentInfo[0].MsgIndex = 0;
        pReadSmsInfoCnf->pMsgContentInfo[0].SimId = MMI_MODEM_SIM_1;
        pReadSmsInfoCnf->pMsgContentInfo[0].ReadSmsType = MMI_MODEM_UNSENT;
        pReadSmsInfoCnf->pMsgContentInfo[1].MsgIndex = 1;
        pReadSmsInfoCnf->pMsgContentInfo[1].SimId = MMI_MODEM_SIM_1;
        pReadSmsInfoCnf->pMsgContentInfo[1].ReadSmsType = MMI_MODEM_SENT;
        pReadSmsInfoCnf->pMsgContentInfo[2].MsgIndex = 2;
        pReadSmsInfoCnf->pMsgContentInfo[2].SimId = MMI_MODEM_SIM_2;
        pReadSmsInfoCnf->pMsgContentInfo[2].ReadSmsType = MMI_MODEM_SENT;
    }
    else
    {
        pReadSmsInfoCnf->ReadMsgCnt = 4;
        pReadSmsInfoCnf->pMsgContentInfo = (MMI_Modem_Msg_Content_Info_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Msg_Content_Info_t) * 4);
        pReadSmsInfoCnf->pMsgContentInfo[0].MsgIndex = 0;
        pReadSmsInfoCnf->pMsgContentInfo[0].SimId = MMI_MODEM_SIM_1;
        pReadSmsInfoCnf->pMsgContentInfo[0].ReadSmsType = MMI_MODEM_UNSENT;
        pReadSmsInfoCnf->pMsgContentInfo[1].MsgIndex = 1;
        pReadSmsInfoCnf->pMsgContentInfo[1].SimId = MMI_MODEM_SIM_1;
        pReadSmsInfoCnf->pMsgContentInfo[1].ReadSmsType = MMI_MODEM_READ;
        pReadSmsInfoCnf->pMsgContentInfo[2].MsgIndex = 2;
        pReadSmsInfoCnf->pMsgContentInfo[2].SimId = MMI_MODEM_SIM_2;
        pReadSmsInfoCnf->pMsgContentInfo[2].ReadSmsType = MMI_MODEM_SENT;
        pReadSmsInfoCnf->pMsgContentInfo[3].MsgIndex = 3;
        pReadSmsInfoCnf->pMsgContentInfo[3].SimId = MMI_MODEM_SIM_2;
        pReadSmsInfoCnf->pMsgContentInfo[3].ReadSmsType = MMI_MODEM_UNREAD;
    }
    Phone_Modem_Read_Sms_Info_Cnf_Handler(pReadSmsInfoCnf);


    printf("%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
#endif
#if MMI_MODEM_SMS_STORE_IN_FILE != 0
    extern void MMI_Modem_Sms_File_Get_Info_Req(MMI_MODEM_SMS_OF_BOX SmsBox);
    MMI_Modem_Sms_File_Get_Info_Req(SmsBox);
#endif
}


INT8                                   *Numberglobal;
INT8                                   *pSmsTextglobal;
/**
 * read sms detail on sim req
 * param (in) pReadSmsReq: MMI_Modem_Read_Sms_Detail_On_Sim_Req_t
 * return  void
 */
VOID MMI_Modem_Read_Sms_Detail_On_Sim_Req(MMI_Modem_Read_Sms_Detail_On_Sim_Req_t *pReadSmsReq)
{
#if 0
    INT8 str[] = "test 234 tex1";
    INT8 Num[] = "13542612345";
    INT8 temptime[] = "15:06:27,06/02/2019";
    MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t *pReadSmsCnf = NULL;
    pReadSmsCnf = (MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Read_Sms_Detail_On_Sim_Cnf_t));

    pReadSmsCnf->MsgIndex = pReadSmsReq->MsgIndex;
    pReadSmsCnf->SimId = pReadSmsReq->SimId;
    pReadSmsCnf->Result = MMI_MODEM_SMS_SUCCESS;
    pReadSmsCnf->pSmsPdu = Hal_Mem_Alloc(1);

    Numberglobal = Hal_Mem_Alloc(strlen(Num) + 1);
    strcpy(Numberglobal,Num);
    pSmsTextglobal = Hal_Mem_Alloc(strlen(str) + 1);
    strcpy(pSmsTextglobal,str);
    g_MsgGlobalCtrl.pTime = Hal_Mem_Alloc(strlen(temptime) + 1);
    strcpy(g_MsgGlobalCtrl.pTime,temptime);
    Phone_Modem_Read_Sms_Detail_On_Sim_Cnf_Handler(pReadSmsCnf);

    Hal_Mem_Free(pReadSmsReq);

    printf("%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
#endif

#if MMI_MODEM_SMS_STORE_IN_FILE != 0
    extern void MMI_Modem_Sms_File_Get_Detail_Req(MMI_Modem_Read_Sms_Detail_On_Sim_Req_t * pReadSmsReq);
    MMI_Modem_Sms_File_Get_Detail_Req(pReadSmsReq);
#endif
}

UINT32 SmscCnt = 0;

/**
 * get sms centre number req
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Get_Smsc_Req(MMI_MODEM_SIM_ID SimId)
{
    char smsc1[] = "123456789";
    char smsc2[] = "987654321";
    MMI_Modem_Get_Smsc_Cnf_t *pGetSmscCnf = NULL;

    pGetSmscCnf = (MMI_Modem_Get_Smsc_Cnf_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Get_Smsc_Cnf_t));
    pGetSmscCnf->pSmsc = Hal_Mem_Alloc(10);
    Hal_Mem_Set(pGetSmscCnf->pSmsc,0,10);
    if(0 == SmscCnt)
    {
        strcpy(pGetSmscCnf->pSmsc,smsc1);
    }
    else
    {
        strcpy(pGetSmscCnf->pSmsc,smsc2);
    }
    SmscCnt++;
    pGetSmscCnf->Result = MMI_MODEM_SMS_SUCCESS;
    pGetSmscCnf->SimId = SimId;
    Phone_Modem_Get_Smsc_Cnf_Handler(pGetSmscCnf);
    printf("%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}



/**
 * set sms centre number req
 * param (in) pSetSmscReq: MMI_Modem_Set_Smsc_Req_t
 * return  void
 */
VOID MMI_Modem_Set_Smsc_Req(MMI_Modem_Set_Smsc_Req_t *pSetSmscReq)
{
    Phone_Modem_Set_Smsc_Cnf(MMI_MODEM_SMS_SUCCESS);
    Hal_Mem_Free(pSetSmscReq->pSmsc);
    pSetSmscReq->pSmsc = NULL;
    Hal_Mem_Free(pSetSmscReq);

    printf("%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}



/**
 * set delivery report flg req
 * param (in) pSetDeliveryRep: MMI_Modem_Set_Delivery_Req_t
 * return  void
 */
VOID MMI_Modem_Set_Delivery_Rep_Req(MMI_Modem_Set_Delivery_Req_t *pSetDeliveryRep)
{
    Phone_Modem_Set_Delivery_Rep_Cnf(MMI_MODEM_SMS_SUCCESS);

    Hal_Mem_Free(pSetDeliveryRep);
    printf("%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}






UINT8 UssdCnt = 0;

/**
 * send ussd req
 * param (in) pSendUssdReq: MMI_Modem_Send_Ussd_Req_t
 * return  void
 */
VOID MMI_Modem_Send_Ussd_Req(MMI_Modem_Send_Ussd_Req_t *pSendUssdReq)
{
    INT8 str[] = "ussd test code";
    MMI_Modem_Send_Ussd_Cnf_t *pSendUssdCnf = NULL;
    pSendUssdCnf = (MMI_Modem_Send_Ussd_Cnf_t *)Hal_Mem_Alloc(sizeof(MMI_Modem_Send_Ussd_Cnf_t));
    Hal_Mem_Set(pSendUssdCnf,0,sizeof(MMI_Modem_Send_Ussd_Cnf_t));
    pSendUssdCnf->SimId = pSendUssdReq->SimId;
    if(0 == UssdCnt)
    {
        pSendUssdCnf->Result = MMI_MODEM_CMD_NOT_CNF;
        UssdCnt = 1;
        Phone_Modem_Send_Ussd_Cnf(pSendUssdCnf);
    }
    else if(1 == UssdCnt)
    {
        pSendUssdCnf->Result = MMI_MODEM_UNKNOWN_CMD;
        UssdCnt = 2;
        Phone_Modem_Send_Ussd_Cnf(pSendUssdCnf);
    }
    else if(2 == UssdCnt)
    {
        pSendUssdCnf->Result = MMI_MODEM_CMD_SUCCESS;
        pSendUssdCnf->pSendUssdCnf = Hal_Mem_Alloc(strlen(str) + 1);
        strcpy(pSendUssdCnf->pSendUssdCnf,str);
        UssdCnt = 3;
        Phone_Modem_Send_Ussd_Cnf(pSendUssdCnf);
    }
    else
    {
        UssdCnt = 0;
        Hal_Mem_Free(pSendUssdCnf);
    }
    Hal_Mem_Free(pSendUssdReq->pSendUssdReq);
    pSendUssdReq->pSendUssdReq = NULL;
    Hal_Mem_Free(pSendUssdReq);
    printf("%s\n", __FUNCTION__);
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}



/**
 * ussd cancel
 * param (in) SimId: MMI_MODEM_SIM_ID
 * return  void
 */
VOID MMI_Modem_Ussd_Cancel_Req(MMI_MODEM_SIM_ID SimId)
{
    UI_Log_Out(UI_SUB_MODULE_MODEM_ADP, UI_LOG_LEVEL_TRACE_1, "%s\n", __FUNCTION__);
}

VOID  MMI_Modem_Query_Pin_Lock(MMI_Modem_Pin_Lock_t * PinLockQuery)
{
}

VOID MMI_Modem_Call_Forward_Query_Req(MMI_MODEM_SIM_ID SimId,MMI_MODEM_CALL_FORWARD_TYPE CallForwardType)
{
}

MMI_MODEM_SIGNAL_BAR MMI_Modem_Get_Signal_Bar_Req(MMI_MODEM_SIM_ID SimId)
{
    if (DummyIdleTick > 2)
    {
        if ((DummyIdleTick % 10) > 5)
        {
            return MMI_MODEM_SIGNAL_BAR_4;
        }
        else
        {
            return MMI_MODEM_SIGNAL_BAR_5;
        }
    }
    return MMI_MODEM_SIGNAL_BAR_0;
}

MODEM_WAKE_UP_REASON MMI_Modem_Adp_Get_Wakeup_Reason_Req(void)
{
    return MODEM_WAKE_UP_OTHERS;
}

VOID MMI_Modem_Select_Character_Set_Req(MMI_MODEM_SIM_ID simId)
{
}

UINT8 VolteState = 0;
UINT8 MMI_Modem_Get_Volte_State_Req(MMI_MODEM_SIM_ID SimId)
{
    return VolteState;
}

VOID MMI_ModemAdp_Set_Volte_State_Req(MMI_MODEM_SIM_ID simId, UINT8 State)
{
    VolteState = State;
}

#endif // BUILD_IN_PC_SIMULATOR

VOID Hal_Mem_Check_Start(VOID)
{
}
VOID Hal_Mem_Check_End(VOID)
{
}
VOID watch_set_sleep_lcd_only(BOOL enable)
{
}
BOOL watch_get_lcd_status(VOID)
{
    return TRUE;
}
VOID watch_suspend_by_ui(VOID)
{
}
